package 蓝桥._14届.特殊日期;

import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;
// 1:无需package
// 2: 类名必须Main, 不可修改

public class Main {
    static Map<Integer,Integer> map = new HashMap<>();

    static int[] m = {0,31,28,31,30,31,30,31,31,30,31,30,31};
    static int[] m2 = {0,31,29,31,30,31,30,31,31,30,31,30,31};

    public static int getBitSum(int n){
        if(n<40&&map.containsKey(n))
            return map.get(n);
        int sum=0;
        while (n>0){
            sum+=n%10;
            n/=10;
        }
        return sum;

    }

    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        //在此输入您的代码...
        int ans=0;
        for(int year=1900;year<=9999;year++){
            int[] t = m;
            if((year%4==0&&year%100!=0)||year%400==0)
                t = m2;

            for (int month = 1; month <=12; month++) {
                for(int day = 1;day<=t[month];day++){
                    if(getBitSum(year)==getBitSum(month)+getBitSum(day)) {
                        ans++;
                        System.out.printf("%d-%d-%d\n",year,month,day);
                    }
                }
            }
        }
        System.out.println(ans);

        scan.close();
    }
}